<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<title>员工信息</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" th:href="@{css/bootstrap.min.css}" />
<link rel="stylesheet" th:href="@{css/bootstrap-responsive.min.css}" />
<link rel="stylesheet" th:href="@{css/uniform.css}" />
<link rel="stylesheet" th:href="@{css/select2.css}" />
<link rel="stylesheet" th:href="@{css/matrix-style.css}" />
<link rel="stylesheet" th:href="@{css/matrix-media.css}" />
<link th:href="@{font-awesome/css/font-awesome.css}" rel="stylesheet" />

</head>
<body>

  <!--Header-part-->
  <div th:replace="~{commons/commons::header}"/>
  <!--close-Header-part-->

  <!--top-Header-menu-->
  <div th:replace="~{commons/commons::user-nav}"/>
  <!--close-top-Header-menu-->



  <!--sidebar-menu-->
  <div th:replace="~{commons/commons::sidebar}"/>
  <!--sidebar-menu-->






<div id="content">
  <div id="content-header">
    <div id="breadcrumb"> <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a href="#" class="current">SelectTables</a> </div>
    <h1>下拉框查询信息</h1>
  </div>
  <div class="container-fluid" >
    <hr>
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-box">
          <div class="widget-title" > <span class="icon"> <i class="icon-th"></i> </span>
              <form th:action="@{/toSelectBox}">
                  <label style="float: left"  >
                      Department:
                      <select name="did" style="width: 150px">
                          <option>---请选择部门---</option>
                          <option th:each="dept:${depts}"
                                  th:value="${dept.getDepartmentID()}"
                                  th:text="${dept.getDepartmentName()}">
                      </select>
                      <input type="submit"  value="搜索">
                  </label>
              </form><!--下拉框查询-->

            <form th:action="@{/search}">
                <label>
                    <input type="text" name="userName" placeholder="请输入姓名...">
                <!--    <input type="text" name="userAge" placeholder="请输入年纪...">-->
                    <input type="submit"  value="搜索">
                    <a class="btn btn-sm btn-primary" th:href="@{/user}" style="float: right">返回用户页</a>
                </label>

            </form>

          </div>

          <div class="widget-content nopadding" style="text-align: center">
            <table class="table table-bordered table-striped" >
              <thead>
                <tr>
                  <th>UserNumber</th>
                  <th>UserName</th>
                  <th>Department</th>
                  <th>UserSex</th>
                  <th>UserAge</th>
                  <th>UserTel</th>
                  <th>DimissionTime</th>
                  <th>BasePay</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                  <tr th:each="useri:${udid}" >
                  <td th:text="${useri.getUserNumber()}"></td>
                  <td th:text="${useri.getUserName()}"></td>
                  <td th:text="${useri.getDepartment().getDepartmentName()}"></td>
                  <td th:text="${useri.getUserSex()==1?'男':'女'}"></td>
                  <td th:text="${useri.getUserAge()}"></td>
                          <td >[[${useri.getUserTel()}]]</td>
                         <!-- <td th:text="${useri.getUserAge()}"/>-->
                  <td th:text="${#dates.format(useri.getDimissionTime(),'yyyy-MM-dd')}"></td>
                  <td th:text="${useri.getBasePay()}"/>
                  <td >
                    <!--button改为a 获取h:href编辑行的目标id-->
                    <a class="btn btn-sm btn-primary" th:href="@{/toUpdate/}+${useri.getUserID()}">编辑</a>

                    <a class="btn btn-sm btn-danger" th:href="@{/delete/}+${useri.getUserID()}">删除</a>
                    <!--  <a class="btn btn-sm btn-success" th:href="@{/toAdd}">添加</a>&lt;!&ndash;添加员工按钮GET &ndash;&gt;-->
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<!--Footer-part-->
<div class="row-fluid">
  <div id="footer" class="span12">Copyright &copy; 2018.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></div>
</div>
<!--end-Footer-part-->
<script src="js/jquery.min.js"></script> 
<script src="js/jquery.ui.custom.js"></script> 
<script src="js/bootstrap.min.js"></script> 
<script src="js/jquery.uniform.js"></script> 
<script src="js/select2.min.js"></script> 
<script src="js/jquery.dataTables.min.js"></script> 
<script src="js/matrix.js"></script> 
<script src="js/matrix.tables.js"></script>
</body>
</html>
